package com.jiang.jixiang.ui.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jiang.jixiang.R;
import com.jiang.jixiang.bean.SellerInfoBean;
import com.jiang.jixiang.bean.SellerListBean;
import com.ws.universal.tools.headimgview.CircleImageView;
import com.ws.universal.tools.utils.StringUtils;
import com.ws.universal.tools.utils.glide.GlideUtils;

public class NearbyMerchantAdapter extends BaseQuickAdapter<SellerListBean, BaseViewHolder> {
    public NearbyMerchantAdapter() {
        super(R.layout.item_nearbymerchant);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, SellerListBean bean) {
        holder.setText(R.id.tvItemName, bean.getName());
        holder.setText(R.id.tvItemAddress, bean.getAddress());
        holder.setText(R.id.tvItemTime, StringUtils.getString(bean.getShop_start(), "-", bean.getShop_end()));
        holder.setText(R.id.tvItemHire, StringUtils.getString(bean.getBorrow_num()));
        holder.setText(R.id.tvItemReturn, StringUtils.getString(bean.getReturn_num()));
        holder.setText(R.id.tvItemDistance, bean.getDistance());
        CircleImageView imgItem = holder.findView(R.id.imgItem);
        GlideUtils.CreateImageRound(bean.getLogo(), imgItem, R.mipmap.icon_defult_nearbylist, R.mipmap.icon_defult_nearbylist);
    }
}
